package com.example.springboot3.controller;

import com.example.springboot3.common.Result;
import com.example.springboot3.exception.CustomException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping("/hello")
    public Result hello(){
//        int a = 1/0;
//        return "hello world";
        throw new CustomException("400","自定义异常");
    }
}
